package com.soft.mainsite.mybatis.mapper;

import com.soft.mainsite.mybatis.model.TCmsUserSite;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.Select;
import tk.mybatis.mapper.common.Mapper;

import java.util.List;

/**
 * TCmsUserSiteMapper
 *
 * @author Jin
 * @create 2017-06-16
 **/
public interface TCmsUserSiteMapper extends Mapper<TCmsUserSite> {

    /**
     * 根据站点id删除
     *
     * @param siteId
     * @return
     */
    @Delete("delete from t_cms_user_site where site_id = #{siteId}")
    int deleteBySiteId(@Param("siteId") Integer siteId);

    /**
     * 根据站点id查询
     *
     * @param siteId
     * @return
     */
    @Select("SELECT *  FROM  t_cms_user_site where site_id = #{siteId}")
    @ResultMap("BaseResultMap")
    List<TCmsUserSite> selectBySiteId(@Param("siteId") Integer siteId);

}